package top.zywork.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import top.zywork.service.PayNotifyService;
import top.zywork.strategy.order.OrderContext;
import top.zywork.weixin.PayResult;
import top.zywork.weixin.RefundResult;

/**
 * 订单微信支付回调服务接口实现类<br/>
 *
 * 创建于2019-07-30<br/>
 *
 * @author http://zywork.top 王振宇
 * @version 1.0
 */
@Service(value = "goodsOrderWeixinPayNotifyService")
public class GoodsOrderWeixinPayNotifyServiceImpl implements PayNotifyService {

    @Autowired
    private OrderContext orderContext;


    @Override
    @Transactional(rollbackFor = Exception.class)
    public void wxPaySuccessNotify(String type,PayResult payResult) {
        orderContext.wxPaySuccessNotify(type,payResult);
    }

    @Override
    public void wxPayFailNotify(String type,PayResult payResult) {
        orderContext.wxPayFailNotify(type,payResult);
    }


    @Override
    public void wxRefundSuccessNotify(String type,RefundResult refundResult) {
        orderContext.wxRefundSuccessNotify(type,refundResult);
    }

    @Override
    public void wxRefundFailNotify(String type,RefundResult refundResult) {
        orderContext.wxRefundFailNotify(type,refundResult);
    }

}
